/*
package cn.tedu.apps_system.base.config;


import cn.tedu.apps_system.service.impl.UserDetailServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) //激活鉴权
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Bean
    UserDetailServiceImpl userDetailService() {
        return new UserDetailServiceImpl();
    }


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.
                //1.配置请求授权规则
                authorizeRequests()
                .antMatchers("/api/v1/public/**").permitAll()
                .anyRequest().authenticated()
                .and()

                //2.配置表单登录
                .formLogin()
                .defaultSuccessUrl("/index.html")
                .permitAll()
                .and()

                //3.配置退出登录
                .logout()
                .permitAll();
    }
}
*/
